import request from '@/utils/request'

const USER_URL = '/user'

export function login(data) {
  return request({
    url: `${USER_URL}/login`,
    method: 'post',
    data
  })
}

export function register(data) {
  return request({
    url: `${USER_URL}/register`,
    method: 'post',
    data
  })
}

export function resetPassword(data) {
  return request({
    url: `${USER_URL}/password`,
    method: 'put',
    data
  })
}

export function getUserInfo() {
  return request({
    url: `${USER_URL}/getUserInfo`,
    method: 'get'
  })
}

export function updateProfile(data) {
  return request({
    url: `${USER_URL}/profile`,
    method: 'put',
    data
  })
}

export function sendEmailCode(email) {
  return request({
    url: `${USER_URL}/code`,
    method: 'post',
    data: { email }
  })
} 